PROCEDURE MCGRATH2
CLEAR SCREEN
STORE 0 TO SUBTOTAL,BAL,COUNT
STORE ' ' TO FIN
USE B30.Y97
PAGE=1
SET DEVI TO SCREEN
END=DATE()
STORE  CTOD('  /  /  ') TO START
@ 2,0 SAY 'Date to start interest from ' get start PICTURE '@D'
READ
MNTH=MONTH(START)
GO MNTH
IF MNTH=1
@ 10,3 SAY 'This is the first month of the year.Is there a balnce from last year ?'
STORE 0 TO FORWARD
IF opconfirm()
@ 10,3 SAY 'Enter the amount to bring forward . ' GET FORWARD PICTURE '9999.99'
ENDIF
DAYS=END-START
STORE '  ' to Last
@ 3,0 SAY 'Enter the number of the last month to be included in this invoice . ' get last
LAST=VAL(LAST)
STORE 1 TO PAGE
SET DEVI TO PRINT
@ 0,0 SAY 'PAGE '+STR(PAGE,3)
STORE 12 TO ROW
@ ROW,15 SAY 'MAINTENANCE FEE DETAIL FOR DEBRA KANE UNIT B30'
STORE ROW+2 TO ROW
DO WHILE .T.
DAYS=DATE()-START
AMOUNT=(MAINT_FEE)*((1.00032876712)^(DAYS))
FINE=.1*MAINT_FEE
INTREST=AMOUNT-MAINT_FEE
SUBTOTAL=INTREST+FINE+MAINT_FEE
@ ROW,9 SAY 'MAINTENANCE FEE                                     '+STR(MAINT_FEE)
ROW=ROW+1
@ row,9 say 'INTEREST FROM '+DTOC(START)+' TO '+DTOC(END)+'                 '+STR(INTREST,8,2)
STORE ROW+1 TO ROW
@ row,9 say 'LATE FEE                                           ' +STR(FINE,8,2)
@ row, 62 say replicate('_',6)
@ row,9 say 'SUBTOTAL                                           '+STR(SUBTOTAL,8,2)
@ row,9 say 'UNPAID BALANCE                                     '+STR(BALANCE,8,2)
STORE ROW+3 TO ROW
MNTH=MNTH+1
STORE COUNT+1 TO COUNT
IF COUNT=5
STORE 1 TO ROW,COUNT
STORE PAGE+1 TO PAGE
@ ROW,0 SAY 'PAGE '+STR(PAGE,2)
ROW=ROW+2
IF MNTH>LAST
EXIT
START=CTOD(STR(MNTH)+'/01/96')
REPLACE INTEREST WITH INTREST,FINE_AMT WITH FINE
IF FORWARD=0
REPLACE BALANCE WITH SUBTOTAL+BAL
ELSE
REPLACE BALANCE WITH SUBTOTAL + BAL+FORWARD
BAL=SUBTOTAL+BAL
SKIP
ENDDO
USE B30.Y96
GO BOTT
@ ROW+1,9 SAY 'TOTAL                                             '+STR(BALANCE,9,2)
*@ ROW+2,20 SAY 'Last page'
@ row+3,0 say ' '
SET PRINT OFF
GO TOP
BROWSE()
RETURN